//
//  ServiceIncomeTableViewCell.m
//  AnXin100
//
//  Created by Sakura on 2018/11/10.
//  Copyright © 2018 tzhg. All rights reserved.
//

#import "ServiceIncomeTableViewCell.h"

@interface ServiceIncomeTableViewCell ()

@property (nonatomic, strong) UIImageView *userImage;

@property (nonatomic, strong) UILabel *incomeLabel;

@property (nonatomic, strong) UILabel *userNameLabel;
@end

@implementation ServiceIncomeTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self creatCell];
    }
    return self;
}

- (void)creatCell {
    _userImage = [UIImageView new];
    _userImage.layer.cornerRadius = 20;
    _userImage.layer.masksToBounds = YES;
    _userImage.image = [UIImage imageNamed:@"xy.jpg"];
    [self.contentView addSubview:_userImage];
    
    _userNameLabel = [UILabel new];
    _userNameLabel.font = FONT_SIXTEEN;
    _userNameLabel.textColor = COLOR_DIV;
    _userNameLabel.text = @"薛之谦";
    [self.contentView addSubview:_userNameLabel];
    
    _incomeLabel = [UILabel new];
    _incomeLabel.font = FONT_FOURTEEN;
    _incomeLabel.textColor = COLOR_Gray;
    _incomeLabel.text = @"+120.00";
    _incomeLabel.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:_incomeLabel];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    _userImage.frame = CGRectMake(10, 10, 40, 40);
    _userNameLabel.frame = CGRectMake(60, 20, (SCREEN_WIDTH - 60) / 2 - 20, 20);
    _incomeLabel.frame = CGRectMake(CGRectGetMaxX(_userNameLabel.frame) + 10, 20, _userNameLabel.mj_w, 20);

}



- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
